<template>
	<view class="con">

		<view class="box" :style="'padding-top:'+navHeight+'rpx;'">
			<image class="img" v-if="topshow" src="../../static/fanhui.png" mode="" @click="fanhui"></image>
			<view v-else class="zw" />
			<view class="title">
				{{title}}
			</view>
			<view class="zw" />
		</view>
	</view>
</template>

<script>
	import {
		getCurrentInstance
	} from "vue";
	export default {
		name: "top",
		props: {
			title: {
				default: ''
			},
			topshow: {
				default: true
			},
		},
		data() {
			return {
				navHeight: getCurrentInstance().appContext.config.globalProperties.$navHeight,
			};
		},
		methods: {
			fanhui() {
				uni.navigateBack()
			}
		}

	}
</script>

<style lang="less">
	.con {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999999;
		width: 750rpx;

		.box {

			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 30rpx;

			.img {
				width: 19rpx;
				height: 36rpx;
			}

			.zw {
				width: 19rpx;
				height: 36rpx;
			}

			.title {
				font-size: 36rpx;
				font-weight: 700;
				color: #000000;
			}
		}
	}
</style>